package com.gxc.mall.user.manager.impl;

import com.gxc.mall.user.entity.UserEntity;
import com.gxc.mall.user.manager.UserManager;
import com.gxc.mall.user.repository.UserRepository;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import javax.transaction.Transactional;

/**
 * @author GongXincheng
 * @since 2019-09-20 16:00
 */
@Component
public class UserManagerImpl implements UserManager {

    @Resource
    private UserRepository userRepository;

    @Override
    @Transactional(rollbackOn = Exception.class)
    public UserEntity addUser(UserEntity userEntity) {
        UserEntity save = userRepository.save(userEntity);
        return save;
    }

}
